package com.ds.lens.data.common.constant;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ethan
 */
public enum LayerEnum {

    LIBRARY("library"),
    HTTP("http"),
    RPC("rpc"),
    MQ("mq"),
    CACHE("cache"),     //未来废弃，归入DB
    SQL("sql"),         //未来废弃，归入DB
    NO_SQL("nosql"),    //未来废弃，归入DB
    DB("db"),           //暂未启用

    MOBILE_CLIENT("mobile");

    @Getter
    private String desc;

    LayerEnum(String desc) {
        this.desc = desc;
    }

    private static Map<String, LayerEnum> layerEnumMap = new HashMap<String, LayerEnum>(11);

    static {
        for(LayerEnum layerEnum : LayerEnum.values()){
            layerEnumMap.put(layerEnum.desc, layerEnum);
        }
    }

    public static LayerEnum valueOfDesc(String desc) {
        return layerEnumMap.get(desc);
    }


}
